package com.nandi.deviceinstall.contract

import com.nandi.deviceinstall.base.BaseView
import com.nandi.deviceinstall.bean.*
import com.nandi.deviceinstall.net.dto.TapAddDTO

import io.reactivex.Flowable
import okhttp3.RequestBody
import okhttp3.ResponseBody
import java.io.File


interface EquimentStepContract {
    interface Model {
        fun getListCity(token: String, district: String): Flowable<CityBean>

        fun getListTown(token: String, id: Int): Flowable<TownBean>

        fun getListDisaster(token: String, areaCode: String): Flowable<DisasterBean>

        fun executeDisNum(token: String, disName: String, areaCode: String): Flowable<DisNumBean>

        fun uploadPic(token: String, file: File, type: Int): Flowable<UploadPicBean>

        fun removePicFile(token: String, sourcePath: String, type: Int): Flowable<RemovePicBean>

        fun executeAddTap(token: String, params: TapAddDTO): Flowable<TapAddResultBean>

        fun executeUpdateTap(token: String, params: TapAddDTO): Flowable<TapAddResultBean>

        fun executeListDisName(token: String, disasterName: String, town: String): Flowable<DisNameBean>
    }

    interface View : BaseView {
        override fun showLoading()

        override fun hideLoading()

        override fun onError(msg: String, code: Int)

        fun handlerListCityResult(result: CityBean)

        fun handlerListTownResult(result: TownBean)

        fun handlerListDisasterResult(result: DisasterBean)

        fun handlerDisNum(result: DisNumBean)

        fun uploadPicSuccess(result: UploadPicBean)

        fun removePicFile(result: RemovePicBean)

        fun handlerAddTapResult(result: TapAddResultBean)

        fun handlerUpdateTapResult(result: TapAddResultBean)

        fun handlerDisNameResult(result: DisNameBean)

        //fun downPicSuccess(result: ResponseBody, fileName: String, resultPath: String)
    }

    interface Presenter {
        fun requestListTown(token: String, id: Int)

        fun requestListCity(token: String, district: String)

        fun requestListDisaster(token: String, current: Int, size: Int, areaCode: String)

        fun requestDisNum(token: String, disName: String, areaCode: String)

        fun requestUploadPic(token: String, file: File, type: Int)

        fun requestRemovePicFile(token: String, sourcePath: String, type: Int)

        fun requestAddTap(token: String, params: TapAddDTO)

        fun requestUpdateTap(token: String, params: TapAddDTO)

        fun requestDisName(token: String, disasterName: String, town: String)
    }
}
